Chromium Code Reviews| Index: public/platform/WebMessagePortChannelClient.h |
| diff --git a/public/platform/WebMessagePortChannelClient.h b/public/platform/WebMessagePortChannelClient.h |
| index 9389338bc37d6c01d478ca50332773e55574cf69..92a3c73890ba5d2b835e03d8802248f3909d6e55 100644 |
| --- a/public/platform/WebMessagePortChannelClient.h |
| +++ b/public/platform/WebMessagePortChannelClient.h |
| @@ -31,10 +31,13 @@ |
| #ifndef WebMessagePortChannelClient_h |
| #define WebMessagePortChannelClient_h |
| +#include <v8.h> |
| + |
| namespace blink { |
| // Provides an interface for users of WebMessagePortChannel to be notified |
| -// when messages are available. |
| +// when messages are available. This also gives users of WebMessagePortChannel |
| +// access to the V8 Context this message port lives in. |
| class WebMessagePortChannelClient { |
| public: |
| // Alerts that new messages have arrived, which are retrieved by calling |
| @@ -42,6 +45,20 @@ public: |
| // on any thread. |
| virtual void messageAvailable() = 0; |
| + // Returns the V8 isolate this message port lives in. |
| + // Do not rely on this API, it is only exposed so content code can convert |
| + // messages to base::Value, and will be removed when this conversion can be |
| + // integrated into blink itself. |
| + virtual v8::Isolate* scriptIsolate() = 0; |
| + |
| + // Returns a V8 context messages sent to this port can be (de)serialized in. |
| + // Can return null if no valid V8 context could be determined. |
| + // Do not rely on this API, it is only exposed so content code can convert |
| + // messages to base::Value, and will be removed when this conversion can be |
| + // integrated into blink itself. |
| + // FIXME: Remove this method when no longer needed (http://crbug.com/461906) |
| + virtual v8::Handle<v8::Context> scriptContextForMessageConversion() = 0; |
|
jochen (gone - plz use gerrit)
2015/02/26 15:03:07
nit. please use v8::Local instead of v8::Handle
|
| + |
| protected: |
| ~WebMessagePortChannelClient() { } |
| }; |