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

Side by Side Diff: components/test_runner/test_plugin.cc

Issue 1817463003: Fix crash without GPU in test_plugin.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "components/test_runner/test_plugin.h" 5 #include "components/test_runner/test_plugin.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 std::string("TestPlugin: canCreateWithoutRenderer\n")); 168 std::string("TestPlugin: canCreateWithoutRenderer\n"));
169 } 169 }
170 170
171 TestPlugin::~TestPlugin() { 171 TestPlugin::~TestPlugin() {
172 } 172 }
173 173
174 bool TestPlugin::initialize(blink::WebPluginContainer* container) { 174 bool TestPlugin::initialize(blink::WebPluginContainer* container) {
175 blink::WebGraphicsContext3D::Attributes attrs; 175 blink::WebGraphicsContext3D::Attributes attrs;
176 context_ = 176 context_ =
177 blink::Platform::current()->createOffscreenGraphicsContext3D(attrs); 177 blink::Platform::current()->createOffscreenGraphicsContext3D(attrs);
178 gl_ = context_->getGLES2Interface(); 178 gl_ = context_ ? context_->getGLES2Interface() : nullptr;
179 179
180 if (!InitScene()) 180 if (!InitScene())
181 return false; 181 return false;
182 182
183 layer_ = cc::TextureLayer::CreateForMailbox(this); 183 layer_ = cc::TextureLayer::CreateForMailbox(this);
184 web_layer_ = make_scoped_ptr(new cc_blink::WebLayerImpl(layer_)); 184 web_layer_ = make_scoped_ptr(new cc_blink::WebLayerImpl(layer_));
185 container_ = container; 185 container_ = container;
186 container_->setWebLayer(web_layer_.get()); 186 container_->setWebLayer(web_layer_.get());
187 if (re_request_touch_events_) { 187 if (re_request_touch_events_) {
188 container_->requestTouchEventType( 188 container_->requestTouchEventType(
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 return kPluginPersistsMimeType; 732 return kPluginPersistsMimeType;
733 } 733 }
734 734
735 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { 735 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) {
736 return mime_type == TestPlugin::MimeType() || 736 return mime_type == TestPlugin::MimeType() ||
737 mime_type == PluginPersistsMimeType() || 737 mime_type == PluginPersistsMimeType() ||
738 mime_type == CanCreateWithoutRendererMimeType(); 738 mime_type == CanCreateWithoutRendererMimeType();
739 } 739 }
740 740
741 } // namespace test_runner 741 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698