Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Side by Side Diff: content/renderer/pepper/v8_var_converter.h

Issue 264303002: PPAPI: Implement synchronous postMessage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H 5 #ifndef CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H
6 #define CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H 6 #define CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // reference. The callback is run when conversion is complete with the 55 // reference. The callback is run when conversion is complete with the
56 // resulting var and a bool indicating success or failure. Conversion may be 56 // resulting var and a bool indicating success or failure. Conversion may be
57 // asynchronous because converting some resources may result in communication 57 // asynchronous because converting some resources may result in communication
58 // across IPC. |context| is guaranteed to only be used synchronously. If 58 // across IPC. |context| is guaranteed to only be used synchronously. If
59 // the conversion can occur synchronously, |callback| will not be run, 59 // the conversion can occur synchronously, |callback| will not be run,
60 // otherwise it will be run. 60 // otherwise it will be run.
61 VarResult FromV8Value( 61 VarResult FromV8Value(
62 v8::Handle<v8::Value> val, 62 v8::Handle<v8::Value> val,
63 v8::Handle<v8::Context> context, 63 v8::Handle<v8::Context> context,
64 const base::Callback<void(const ppapi::ScopedPPVar&, bool)>& callback); 64 const base::Callback<void(const ppapi::ScopedPPVar&, bool)>& callback);
65 bool FromV8ValueSync(v8::Handle<v8::Value> val,
66 v8::Handle<v8::Context> context,
67 ppapi::ScopedPPVar* result_var);
65 private: 68 private:
66 // Returns true on success, false on failure. 69 // Returns true on success, false on failure.
67 bool FromV8ValueInternal(v8::Handle<v8::Value> val, 70 bool FromV8ValueInternal(v8::Handle<v8::Value> val,
68 v8::Handle<v8::Context> context, 71 v8::Handle<v8::Context> context,
69 ppapi::ScopedPPVar* result_var); 72 ppapi::ScopedPPVar* result_var);
70 73
71 // The message loop to run the callback to |FromV8Value| from. 74 // The message loop to run the callback to |FromV8Value| from.
72 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; 75 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
73 76
74 // The converter to use for converting V8 vars to resources. 77 // The converter to use for converting V8 vars to resources.
75 scoped_ptr<ResourceConverter> resource_converter_; 78 scoped_ptr<ResourceConverter> resource_converter_;
76 79
77 DISALLOW_COPY_AND_ASSIGN(V8VarConverter); 80 DISALLOW_COPY_AND_ASSIGN(V8VarConverter);
78 }; 81 };
79 82
80 } // namespace content 83 } // namespace content
81 84
82 #endif // CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H 85 #endif // CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | content/renderer/pepper/v8_var_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698