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

Side by Side Diff: trunk/src/pdf/instance.cc

Issue 318743003: Revert 273547 "Reset scoped_ptr to make plugin crash before ente..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
« 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 (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 "pdf/instance.h" 5 #include "pdf/instance.h"
6 6
7 #include <algorithm> // for min() 7 #include <algorithm> // for min()
8 #define _USE_MATH_DEFINES // for M_PI 8 #define _USE_MATH_DEFINES // for M_PI
9 #include <cmath> // for log() and pow() 9 #include <cmath> // for log() and pow()
10 #include <math.h> 10 #include <math.h>
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 AddPerInstanceObject(kPPPPdfInterface, this); 301 AddPerInstanceObject(kPPPPdfInterface, this);
302 302
303 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_MOUSE); 303 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
304 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_WHEEL); 304 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_WHEEL);
305 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); 305 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
306 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_TOUCH); 306 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_TOUCH);
307 } 307 }
308 308
309 Instance::~Instance() { 309 Instance::~Instance() {
310 RemovePerInstanceObject(kPPPPdfInterface, this); 310 RemovePerInstanceObject(kPPPPdfInterface, this);
311 // TODO(vitalybuka): remove after crbug.com/372095 fixed.
312 // Reset to NULL to make it crash in HandleDocumentLoad if called for
313 // deleted instance. scoped_ptr::~scoped_ptr does not reset pointer to NULL.
314 engine_.reset();
315 } 311 }
316 312
317 bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) { 313 bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) {
318 // For now, we hide HiDPI support behind a flag. 314 // For now, we hide HiDPI support behind a flag.
319 if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI)) 315 if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI))
320 hidpi_enabled_ = true; 316 hidpi_enabled_ = true;
321 317
322 printing_enabled_ = pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_PRINTING); 318 printing_enabled_ = pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_PRINTING);
323 if (printing_enabled_) { 319 if (printing_enabled_) {
324 CreateToolbar(kPDFToolbarButtons, arraysize(kPDFToolbarButtons)); 320 CreateToolbar(kPDFToolbarButtons, arraysize(kPDFToolbarButtons));
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2714 return instance_->HasScriptableMethod(name, exception); 2710 return instance_->HasScriptableMethod(name, exception);
2715 } 2711 }
2716 2712
2717 pp::Var PDFScriptableObject::Call(const pp::Var& method, 2713 pp::Var PDFScriptableObject::Call(const pp::Var& method,
2718 const std::vector<pp::Var>& args, 2714 const std::vector<pp::Var>& args,
2719 pp::Var* exception) { 2715 pp::Var* exception) {
2720 return instance_->CallScriptableMethod(method, args, exception); 2716 return instance_->CallScriptableMethod(method, args, exception);
2721 } 2717 }
2722 2718
2723 } // namespace chrome_pdf 2719 } // namespace chrome_pdf
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