OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 #endif | 135 #endif |
136 | 136 |
137 virtual skia::PlatformCanvas* Map() { | 137 virtual skia::PlatformCanvas* Map() { |
138 return dib_->GetPlatformCanvas(width_, height_); | 138 return dib_->GetPlatformCanvas(width_, height_); |
139 } | 139 } |
140 | 140 |
141 virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const { | 141 virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const { |
142 *byte_count = dib_->size(); | 142 *byte_count = dib_->size(); |
143 #if defined(OS_WIN) | 143 #if defined(OS_WIN) |
144 return reinterpret_cast<intptr_t>(dib_->handle()); | 144 return reinterpret_cast<intptr_t>(dib_->handle()); |
145 #elif defined(OS_MACOSX) | 145 #elif defined(OS_MACOSX) || defined(OS_ANDROID) |
146 return static_cast<intptr_t>(dib_->handle().fd); | 146 return static_cast<intptr_t>(dib_->handle().fd); |
147 #elif defined(OS_POSIX) | 147 #elif defined(OS_POSIX) |
148 return static_cast<intptr_t>(dib_->handle()); | 148 return static_cast<intptr_t>(dib_->handle()); |
149 #endif | 149 #endif |
150 } | 150 } |
151 | 151 |
152 virtual TransportDIB* GetTransportDIB() const { | 152 virtual TransportDIB* GetTransportDIB() const { |
153 return dib_.get(); | 153 return dib_.get(); |
154 } | 154 } |
155 | 155 |
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 | 2165 |
2166 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { | 2166 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { |
2167 WebView* webview = render_view_->webview(); | 2167 WebView* webview = render_view_->webview(); |
2168 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; | 2168 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; |
2169 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); | 2169 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); |
2170 if (!url.is_valid()) | 2170 if (!url.is_valid()) |
2171 return false; | 2171 return false; |
2172 | 2172 |
2173 return content::GetContentClient()->renderer()->AllowSocketAPI(url); | 2173 return content::GetContentClient()->renderer()->AllowSocketAPI(url); |
2174 } | 2174 } |
OLD | NEW |