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 "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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 engine_.reset(); | 330 engine_.reset(); |
331 RemovePerInstanceObject(kPPPPdfInterface, this); | 331 RemovePerInstanceObject(kPPPPdfInterface, this); |
332 } | 332 } |
333 | 333 |
334 bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) { | 334 bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) { |
335 v8::StartupData natives; | 335 v8::StartupData natives; |
336 v8::StartupData snapshot; | 336 v8::StartupData snapshot; |
337 pp::PDF::GetV8ExternalSnapshotData(this, &natives.data, &natives.raw_size, | 337 pp::PDF::GetV8ExternalSnapshotData(this, &natives.data, &natives.raw_size, |
338 &snapshot.data, &snapshot.raw_size); | 338 &snapshot.data, &snapshot.raw_size); |
339 if (natives.data) { | 339 if (natives.data) { |
340 natives.compressed_size = natives.raw_size; | |
341 snapshot.compressed_size = snapshot.raw_size; | |
342 v8::V8::SetNativesDataBlob(&natives); | 340 v8::V8::SetNativesDataBlob(&natives); |
343 v8::V8::SetSnapshotDataBlob(&snapshot); | 341 v8::V8::SetSnapshotDataBlob(&snapshot); |
344 } | 342 } |
345 | 343 |
346 // For now, we hide HiDPI support behind a flag. | 344 // For now, we hide HiDPI support behind a flag. |
347 if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI)) | 345 if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI)) |
348 hidpi_enabled_ = true; | 346 hidpi_enabled_ = true; |
349 | 347 |
350 printing_enabled_ = pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_PRINTING); | 348 printing_enabled_ = pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_PRINTING); |
351 if (printing_enabled_) { | 349 if (printing_enabled_) { |
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2801 return instance_->HasScriptableMethod(name, exception); | 2799 return instance_->HasScriptableMethod(name, exception); |
2802 } | 2800 } |
2803 | 2801 |
2804 pp::Var PDFScriptableObject::Call(const pp::Var& method, | 2802 pp::Var PDFScriptableObject::Call(const pp::Var& method, |
2805 const std::vector<pp::Var>& args, | 2803 const std::vector<pp::Var>& args, |
2806 pp::Var* exception) { | 2804 pp::Var* exception) { |
2807 return instance_->CallScriptableMethod(method, args, exception); | 2805 return instance_->CallScriptableMethod(method, args, exception); |
2808 } | 2806 } |
2809 | 2807 |
2810 } // namespace chrome_pdf | 2808 } // namespace chrome_pdf |
OLD | NEW |