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

Side by Side Diff: Source/bindings/v8/custom/V8BlobCustom.cpp

Issue 176853004: Oilpan: move core/fileapi to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 22 matching lines...) Expand all
33 33
34 #include "bindings/v8/ExceptionState.h" 34 #include "bindings/v8/ExceptionState.h"
35 #include "bindings/v8/custom/V8BlobCustomHelpers.h" 35 #include "bindings/v8/custom/V8BlobCustomHelpers.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 39 void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
40 { 40 {
41 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Blob", i nfo.Holder(), info.GetIsolate()); 41 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Blob", i nfo.Holder(), info.GetIsolate());
42 if (!info.Length()) { 42 if (!info.Length()) {
43 RefPtr<Blob> blob = Blob::create(); 43 RefPtrWillBeRawPtr<Blob> blob = Blob::create();
44 v8SetReturnValue(info, blob.release()); 44 v8SetReturnValue(info, blob.release());
45 return; 45 return;
46 } 46 }
47 47
48 uint32_t length = 0; 48 uint32_t length = 0;
49 if (info[0]->IsArray()) { 49 if (info[0]->IsArray()) {
50 length = v8::Local<v8::Array>::Cast(info[0])->Length(); 50 length = v8::Local<v8::Array>::Cast(info[0])->Length();
51 } else { 51 } else {
52 const int sequenceArgumentIndex = 0; 52 const int sequenceArgumentIndex = 0;
53 if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate()) .IsEmpty()) { 53 if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate()) .IsEmpty()) {
(...skipping 17 matching lines...) Expand all
71 } 71 }
72 } 72 }
73 73
74 OwnPtr<BlobData> blobData = BlobData::create(); 74 OwnPtr<BlobData> blobData = BlobData::create();
75 blobData->setContentType(properties.contentType()); 75 blobData->setContentType(properties.contentType());
76 v8::Local<v8::Object> blobParts = v8::Local<v8::Object>::Cast(info[0]); 76 v8::Local<v8::Object> blobParts = v8::Local<v8::Object>::Cast(info[0]);
77 if (!V8BlobCustomHelpers::processBlobParts(blobParts, length, properties.nor malizeLineEndingsToNative(), *blobData, info.GetIsolate())) 77 if (!V8BlobCustomHelpers::processBlobParts(blobParts, length, properties.nor malizeLineEndingsToNative(), *blobData, info.GetIsolate()))
78 return; 78 return;
79 79
80 long long blobSize = blobData->length(); 80 long long blobSize = blobData->length();
81 RefPtr<Blob> blob = Blob::create(BlobDataHandle::create(blobData.release(), blobSize)); 81 RefPtrWillBeRawPtr<Blob> blob = Blob::create(BlobDataHandle::create(blobData .release(), blobSize));
82 v8SetReturnValue(info, blob.release()); 82 v8SetReturnValue(info, blob.release());
83 } 83 }
84 84
85 } // namespace WebCore 85 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/SerializedScriptValue.cpp ('k') | Source/bindings/v8/custom/V8FileCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698