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

Unified Diff: mojo/edk/js/handle.cc

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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/edk/js/handle.h ('k') | mojo/edk/js/handle_close_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/js/handle.cc
diff --git a/mojo/edk/js/handle.cc b/mojo/edk/js/handle.cc
deleted file mode 100644
index de8f3383836494bc63fc67134da1cc88302797a3..0000000000000000000000000000000000000000
--- a/mojo/edk/js/handle.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/edk/js/handle.h"
-
-#include "mojo/edk/js/handle_close_observer.h"
-
-namespace mojo {
-namespace js {
-
-gin::WrapperInfo HandleWrapper::kWrapperInfo = { gin::kEmbedderNativeGin };
-
-HandleWrapper::HandleWrapper(MojoHandle handle)
- : handle_(mojo::Handle(handle)) {
-}
-
-HandleWrapper::~HandleWrapper() {
- NotifyCloseObservers();
-}
-
-void HandleWrapper::Close() {
- NotifyCloseObservers();
- handle_.reset();
-}
-
-void HandleWrapper::AddCloseObserver(HandleCloseObserver* observer) {
- close_observers_.AddObserver(observer);
-}
-
-void HandleWrapper::RemoveCloseObserver(HandleCloseObserver* observer) {
- close_observers_.RemoveObserver(observer);
-}
-
-void HandleWrapper::NotifyCloseObservers() {
- if (!handle_.is_valid())
- return;
-
- FOR_EACH_OBSERVER(HandleCloseObserver, close_observers_, OnWillCloseHandle());
-}
-
-} // namespace js
-} // namespace mojo
-
-namespace gin {
-
-v8::Handle<v8::Value> Converter<mojo::Handle>::ToV8(v8::Isolate* isolate,
- const mojo::Handle& val) {
- if (!val.is_valid())
- return v8::Null(isolate);
- return mojo::js::HandleWrapper::Create(isolate, val.value()).ToV8();
-}
-
-bool Converter<mojo::Handle>::FromV8(v8::Isolate* isolate,
- v8::Handle<v8::Value> val,
- mojo::Handle* out) {
- if (val->IsNull()) {
- *out = mojo::Handle();
- return true;
- }
-
- gin::Handle<mojo::js::HandleWrapper> handle;
- if (!Converter<gin::Handle<mojo::js::HandleWrapper> >::FromV8(
- isolate, val, &handle))
- return false;
-
- *out = handle->get();
- return true;
-}
-
-v8::Handle<v8::Value> Converter<mojo::MessagePipeHandle>::ToV8(
- v8::Isolate* isolate, mojo::MessagePipeHandle val) {
- return Converter<mojo::Handle>::ToV8(isolate, val);
-}
-
-bool Converter<mojo::MessagePipeHandle>::FromV8(v8::Isolate* isolate,
- v8::Handle<v8::Value> val,
- mojo::MessagePipeHandle* out) {
- return Converter<mojo::Handle>::FromV8(isolate, val, out);
-}
-
-
-} // namespace gin
« no previous file with comments | « mojo/edk/js/handle.h ('k') | mojo/edk/js/handle_close_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698