0491f4e887
BUG= R=iposva@google.com, ricow@google.com, sgjesse@google.com, turnidge@google.com Committed: https://code.google.com/p/dart/source/detail?r=40534 Review URL: https://codereview.chromium.org//545483002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40581 260f80e4-7a28-3924-810f-c04153c831b5
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef BIN_ISOLATE_DATA_H_
|
|
#define BIN_ISOLATE_DATA_H_
|
|
|
|
#include "include/dart_api.h"
|
|
#include "platform/globals.h"
|
|
|
|
|
|
namespace dart {
|
|
namespace bin {
|
|
|
|
// Forward declaration.
|
|
class EventHandler;
|
|
|
|
// Data associated with every isolate in the standalone VM
|
|
// embedding. This is used to free external resources for each isolate
|
|
// when the isolate shuts down.
|
|
class IsolateData {
|
|
public:
|
|
explicit IsolateData(const char* url, const char* package_root)
|
|
: script_url(strdup(url)),
|
|
package_root(NULL),
|
|
udp_receive_buffer(NULL) {
|
|
if (package_root != NULL) {
|
|
this->package_root = strdup(package_root);
|
|
}
|
|
}
|
|
~IsolateData() {
|
|
free(script_url);
|
|
free(package_root);
|
|
free(udp_receive_buffer);
|
|
}
|
|
|
|
char* script_url;
|
|
char* package_root;
|
|
uint8_t* udp_receive_buffer;
|
|
|
|
private:
|
|
DISALLOW_COPY_AND_ASSIGN(IsolateData);
|
|
};
|
|
|
|
} // namespace bin
|
|
} // namespace dart
|
|
|
|
#endif // BIN_ISOLATE_DATA_H_
|