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

Unified Diff: mojo/bindings/js/handle.h

Issue 651523002: [Mojo] Fix the namespace for HandleWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/bindings/js/core.cc ('k') | mojo/bindings/js/handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/bindings/js/handle.h
diff --git a/mojo/bindings/js/handle.h b/mojo/bindings/js/handle.h
index e0f00dd52a9762791c6fc7bd5edacaed3f8e3a10..4f0d9b5d120d886c2c7ee09887c3f502fa14b1b2 100644
--- a/mojo/bindings/js/handle.h
+++ b/mojo/bindings/js/handle.h
@@ -11,7 +11,8 @@
#include "gin/wrappable.h"
#include "mojo/public/cpp/system/core.h"
-namespace gin {
+namespace mojo {
+namespace js {
class HandleCloseObserver;
// Wrapper for mojo Handles exposed to JavaScript. This ensures the Handle
@@ -41,6 +42,11 @@ class HandleWrapper : public gin::Wrappable<HandleWrapper> {
ObserverList<HandleCloseObserver> close_observers_;
};
+} // namespace js
+} // namespace mojo
+
+namespace gin {
+
// Note: It's important to use this converter rather than the one for
// MojoHandle, since that will do a simple int32 conversion. It's unfortunate
// there's no way to prevent against accidental use.
@@ -56,24 +62,24 @@ struct Converter<mojo::Handle> {
// We need to specialize the normal gin::Handle converter in order to handle
// converting |null| to a wrapper for an empty mojo::Handle.
template<>
-struct Converter<gin::Handle<gin::HandleWrapper> > {
+struct Converter<gin::Handle<mojo::js::HandleWrapper> > {
static v8::Handle<v8::Value> ToV8(
- v8::Isolate* isolate, const gin::Handle<gin::HandleWrapper>& val) {
+ v8::Isolate* isolate, const gin::Handle<mojo::js::HandleWrapper>& val) {
return val.ToV8();
}
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
- gin::Handle<gin::HandleWrapper>* out) {
+ gin::Handle<mojo::js::HandleWrapper>* out) {
if (val->IsNull()) {
- *out = HandleWrapper::Create(isolate, MOJO_HANDLE_INVALID);
+ *out = mojo::js::HandleWrapper::Create(isolate, MOJO_HANDLE_INVALID);
return true;
}
- gin::HandleWrapper* object = NULL;
- if (!Converter<gin::HandleWrapper*>::FromV8(isolate, val, &object)) {
+ mojo::js::HandleWrapper* object = NULL;
+ if (!Converter<mojo::js::HandleWrapper*>::FromV8(isolate, val, &object)) {
return false;
}
- *out = gin::Handle<gin::HandleWrapper>(val, object);
+ *out = gin::Handle<mojo::js::HandleWrapper>(val, object);
return true;
}
};
« no previous file with comments | « mojo/bindings/js/core.cc ('k') | mojo/bindings/js/handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698